<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <button>回退到上一个页面</button>
  <script>
    var btn = document.querySelector('button');
    btn.onclick = function(){
      // 回退到上一个页面
      // history.back();
      history.go(-1)
    }
    // 声明在全局的属性和方法自动成为window对象属性和方法
    var name = 'zhangsan';
    var sayName = function(){
      console.log(this.name)
    }
    console.log(window.name);
    sayName();
    window.sayName();

    //window对象属性
    console.log(window.innerHeight,'视口区域高度');
    console.log(window.innerWidth,'视口区域宽度');
    console.log(window.outerWidth,'浏览器宽度');
    console.log(window.outerHeight,'浏览器高度');
  </script>
</body>
</html>